/*
 * CatSpriteLoader_test.cpp
 *
 *  Created on: Apr 10, 2014
 *      Author: GW
 */

#include "src/TestMacros.h"
#include "src/CheckMacros.h"
#include "src/TestRunner.h"
#include "src/TimeConstraint.h"
#include "src/ReportAssert.h"

#include "Cats/CatSpriteLoader.h"

SUITE(CatSpriteLoader)
{
	TEST(CatSpriteLoaderGetSpriteFrame)
	{
		CCSpriteFrame* frame = CatSpriteLoader::getSpriteFrame(0);
		bool isNull = frame == 0;
		CHECK_EQUAL(isNull, false);

		frame = 0;
		frame = CatSpriteLoader::getSpriteFrame(WITCH_CAT);
		isNull = frame == 0;
		CHECK_EQUAL(isNull, false);
	}

	TEST(CatSpriteLoaderGetSpecialSpriteFrame)
	{
		CCSpriteFrame* frame = CatSpriteLoader::getSpecialSpriteFrame(BOUNCE_CAT);
		bool isNull = frame == 0;
		CHECK_EQUAL(isNull, true);

		frame = 0;
		frame = CatSpriteLoader::getSpecialSpriteFrame(PUNK_CAT);
		isNull = frame == 0;
		CHECK_EQUAL(isNull, false);
	}

	TEST(CatSpriteLoaderGetCatAnimation)
	{
		CCAnimate* animate = CatSpriteLoader::getCatAnimation(PUNK_CAT, CAT_ANIM_WALK);
		bool isNull = animate == 0;
		CHECK_EQUAL(isNull, false);

		//check non existant animations
		animate = 0;
		animate = CatSpriteLoader::getCatAnimation(FAT_CAT, CAT_ANIM_SKILL);
		isNull = animate == 0;
		CHECK_EQUAL(isNull, true);

	}

	TEST(CatSpriteLoaderGetCatStatusAnimation)
	{
		CCAnimate* animate = CatSpriteLoader::getCatAnimation(CAT_ANIM_DEATH_BLACK);
		bool isNull = animate == 0;
		CHECK_EQUAL(isNull, false);
	}

	TEST(CatSpriteLoaderGetCatProjectileAnimation)
	{
		CCAnimate* animate = CatSpriteLoader::getCatAnimation(WITCH_CAT, CAT_ANIM_PROJ_LAUNCH);
		bool isNull = animate == 0;
		CHECK_EQUAL(isNull, false);

		//check non existant animations
		animate = 0;
		animate = CatSpriteLoader::getCatAnimation(FAT_CAT, CAT_ANIM_PROJ_LAUNCH);
		isNull = animate == 0;
		CHECK_EQUAL(isNull, true);
	}

	TEST(CatSpriteLoaderGetAnimationDuration)
	{
		float duration = CatSpriteLoader::getAnimationDuration(PUNK_CAT, CAT_ANIM_WALK);
		bool isZero = duration == 0;
		CHECK_EQUAL(isZero, false);

		//check non existant animation duration
		duration = 0;
		duration = CatSpriteLoader::getAnimationDuration(FAT_CAT, CAT_ANIM_SKILL);
		isZero = duration == 0;
		CHECK_EQUAL(isZero, true);
	}
}
